/////////////////////////////////////////////////////////////////////////////
// Name:        ax_menu_visual_settings.h
// Purpose:     Visual settings menu class
// Author:      Julian Smart
// Modified by:
// Created:     2009-03-20
// RCS-ID:
// Copyright:   (c) Julian Smart
// Licence:     New BSD License
/////////////////////////////////////////////////////////////////////////////

#ifndef _AX_MENU_VISUAL_SETTINGS_H_
#define _AX_MENU_VISUAL_SETTINGS_H_

/*
TODO:

Text size menu item, as a choice.

Text colour menu item - need colour chooser

Window colour menu item

Container colour menu item

Eventually - customisation of menu control

 */

/*
 * Includes
 */

#include "ax/ax_activator.h"
#include "ax/ax_menu.h"

class AxSpeech;
class AxChoiceMenuItem;
class wxSpinEvent;

/**
    @class AxVisualSettingsMenuItem

    @category{ax}
 */

class AxVisualSettingsMenuItem: public AxMenuItem
{
    DECLARE_CLASS( AxVisualSettingsMenuItem )
    DECLARE_EVENT_TABLE( )

public:
// Constructors

    AxVisualSettingsMenuItem(const AxVisualSettingsMenuItem& item)
    { Copy(item); m_speech = item.m_speech; m_controller = item.m_controller; }
    AxVisualSettingsMenuItem(AxMenuController* controller, AxSpeech* speech);

    void OnSelectTextSize(wxCommandEvent& event);
    void OnSelectTextColour(wxCommandEvent& event);
    void OnSelectWindowColour(wxCommandEvent& event);
    void OnSelectPanelColour(wxCommandEvent& event);

    virtual AxMenuItem* Clone() { return new AxVisualSettingsMenuItem(* this); }

protected:
    AxSpeech*           m_speech;
    AxMenuController*   m_controller;
};

/**
    @class AxVisualSettingsActivator

    Top-level item activator for the speech settings,
    creating the actual menu on demand.

    @category{ax}

 */

class AxVisualSettingsActivator: public AxActivator
{
public:
    
    DECLARE_DYNAMIC_CLASS( AxVisualSettingsActivator )

public:
// Constructors

    AxVisualSettingsActivator() { Init(); }

    AxVisualSettingsActivator(AxSpeech* speech) { m_speech = speech; }

    AxVisualSettingsActivator(const AxVisualSettingsActivator& activator) { Init(); Copy(activator); }

    void Init() { m_speech = NULL; m_mainVoicesItem = NULL; m_contentVoicesItem = NULL; }

    void Copy(const AxVisualSettingsActivator& activator)
    {
        AxActivator::Copy(activator);
        m_speech = activator.m_speech;
        m_mainVoicesItem = activator.m_mainVoicesItem;
        m_contentVoicesItem = activator.m_contentVoicesItem;
    }

    virtual AxActivator* Clone() const { return new AxVisualSettingsActivator(* this); }

    /// Called when the user activates a menu item by pressing return or double-clicking
    virtual AxMenu* Activate(AxMenuController* controller, AxMenuItem* item);

    AxChoiceMenuItem* GetVoicesItem(int channel) const { return channel == 0 ? m_mainVoicesItem : m_contentVoicesItem; }

protected:
    AxSpeech*           m_speech;
    AxChoiceMenuItem*   m_mainVoicesItem;
    AxChoiceMenuItem*   m_contentVoicesItem;
};

#endif
    // _AX_MENU_VISUAL_SETTINGS_H_
